<?php

namespace app\models;

use think\Db;
use think\Model;

class Car extends Model
{
    protected $pk = 'id';
    protected $autoWriteTimestamp = 'datetime';
    protected $createTime = 'created';
    protected $defaultSoftDelete = 0;
    
    public function getModelTextAttr($value, $data)
    {
        $text = '';
        switch ($data['model']) {
            case '1':
                $text = '轿车';
                break;
            case '2':
                $text = 'SUV';
                break;
            case '3':
                $text = '七座';
                break;
            default:
                $text = '未知';
                break;
        }
        return $text;
    }
}
